package com.learner.course.repository;

import com.learner.pojo.course.CourseCollect;
import com.learner.pojo.course.CourseComment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;

import javax.transaction.Transactional;
import java.util.List;

/**
* @Description: 课程评论的数据接口
* @Author: ice2020x
* @Date: 2021/11/12
*/
public interface CourseCommentRepository extends JpaRepository<CourseComment,String> {


    /**
     * @Description: 根据课程id和会员id删除
     * @Author: ice2020x
     * @Date: 2021/11/12
     */
    @Modifying
    @Transactional
    int deleteByCourseIdAndMemberId(String courseId, String memberId);

    List<CourseComment> findByCourseIdOrderByGmtCreateAsc(String courseId);
}
